require 'tm_ui'
require 'tm_progress'

print "RequestString: "
puts TextMate::UI.request_string({:title => "My Title", :prompt => "My Prompt", :default => "My Default"})

print "RequestSequreString: "
puts TextMate::UI.request_secure_string({:title => "My Title", :prompt => "My Prompt", :default => "My Default"})

print "RequestItem: "
puts TextMate::UI.request_item(:items => ["item1", "item   2", "-", "item 444"], :title => "My Title", :prompt => "My Prompt", :default => "item 444")

print "ProgressDialog: indeterminate"
TextMate.call_with_progress(:title =>'Now Testing', :summary => 'Starting Up...') do
    sleep 3
end
puts
print "ProgressDialog: determinate"
TextMate.call_with_progress(:title =>'Now Testing',
          :summary => 'Starting Up...',
          :indeterminate => false,
          :cancel => lambda {puts "Canceled!"} ) do |dialog|
    sleep 1
    dialog.parameters = {'summary' => 'Loving the alien...','progressValue' => 30 }
    sleep 1
    dialog.parameters = {'summary' => 'Eating the pie...','progressValue' => 60 }
    sleep 1
    dialog.parameters = {'summary' => 'Vacuuming the rug...','progressValue' => 90 }
    sleep 1
    dialog.parameters = {'summary' => 'Complete!','progressValue' => 100 }
    sleep 2
  end
puts

end

print "Simple notification (asynchronous)"
TextMate::UI.simple_notification(:title => "My Title", :summary => "This is summary for the log", :log => "Long\nand meaningless\nlog entries\njust for\ntesting the\nNIB\n")
puts
